package com.dabai.iot.mqtt.model;

import cn.hutool.core.date.DateUtil;
import io.vertx.mqtt.MqttEndpoint;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;

import java.util.Date;

/**
 * 服务端订阅连接会话
 *
 * @author kev1n
 */
@Slf4j
public class ServerConnectionSession {

    @Getter
    private final String tenantId;

    @Getter
    private final MqttEndpoint mqttEndpoint;

    /**
     * 上线时间
     */
    @Getter
    private final Date onlineDate;

    public ServerConnectionSession(String tenantId, MqttEndpoint mqttEndpoint) {
        this.tenantId = tenantId;
        this.mqttEndpoint = mqttEndpoint;

        this.onlineDate = DateUtil.date();
    }

}
